{{!--
Copyright (C) 2017 Draios inc.

This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License version 2 as
published by the Free Software Foundation.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see <http://www.gnu.org/licenses/>.
--}}

<div class="wsd-capture-panel__header">
    <div class="wsd-capture-panel__breadcrumbs">
        {{wsd-capture-breadcrumbs
            steps=drilldownInfo
            select=(action "navigateTo")
        }}
    </div>

    {{#if isSearchAvailable}}
        <div class="wsd-capture-panel__controls">
            <div class="wsd-capture-panel__control">
                {{sd-button
                    iconName="search_black"
                    title="Find Text"
                    classNames="sd-button--fab sd-button--highlight-on-hover"
                    isActive=isSearchActive
                    click=(action "toggleSearch")
                }}
            </div>
        </div>
    {{/if}}
</div>

<div class="wsd-capture-panel__content">
    <div class="wsd-capture-panel__view-list">
        {{wsd-view-list
            selectedViewId=selectedViewId
            steps=drilldownInfo
            select=(action "selectView")
        }}
    </div>

    <div class="wsd-capture-panel__data">
        {{#if isDataSettingsBarVisible}}
            <div class="wsd-capture-panel__data-settings-bar">
                {{#if isFilterActive}}
                    <div class="wsd-capture-panel__data-settings-filter">
                        <label class="wsd-capture-panel__data-settings-label">
                            <span class="wsd-capture-panel__data-settings-label-text">Sysdig Filter</span>
                        </label>
                        <div class="wsd-capture-panel__data-settings-input">
                            {{sd-input
                                name="filter"
                                value=currentFilter
                                placeholder=drilldownFilter
                                isAcceptChangeMode=true
                                changeValue=(action applyFilter)
                                cancel=(action "closeFilter")
                            }}
                        </div>
                    </div>
                {{/if}}
                {{#if isSearchActive}}
                    <div class="wsd-capture-panel__data-settings-search">
                        <label class="wsd-capture-panel__data-settings-label">
                            <span class="wsd-capture-panel__data-settings-label-text">Find Text</span>
                        </label>
                        <div class="wsd-capture-panel__data-settings-input">
                            {{sd-search-box
                                name="search"
                                changeValue=(action applySearch)
                                cancel=(action "closeSearch")
                            }}
                        </div>
                    </div>
                {{/if}}
            </div>
        {{/if}}

        {{yield}}
    </div>
</div>

<div class="wsd-capture-panel__timelines">
    {{wsd-metric-timelines
        timeWindow=timeWindow
        filter=filter
        timelines=timelines
        filePath=filePath
        selectTimeWindow=(action selectTimeWindow)
        drillDown=(action drillDown)
        remove=(action removeMetricTimeline)
    }}
</div>
